<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>用户登录切换案例</title>
    <script src="../lib/vue_v2.6.14.js"></script>
  </head>
  <body>
    <div id="app">
      <span v-if="showUser">
        <label for="userName">用户姓名</label>
        <input type="text" id="userName" placeholder="用户姓名" />
      </span>
      <span v-else>
        <label for="userEmail">用户邮箱</label>
        <input type="text" id="userEmail" placeholder="用户邮箱" />
      </span>
      <button @click="showUser = !showUser">切换类型</button>
    </div>

    <script>
      const vm = new Vue({
        el: '#app',
        data: {
          showUser: true
        }
      })
    </script>
  </body>
</html>
